import numpy as np
from numpy.typing import NDArray
from rich import print


class Question:

    def __init__(self, *, choice_n: int, puzzle_n: int, guess_n: int) -> None:
        self._answer = np.random.randint(0, choice_n, size=puzzle_n)
        self._question = np.random.randint(0, choice_n, size=[guess_n, puzzle_n])
        self._score = self.check_answer(self._question)

    def check_answer(self, guess: NDArray[np.integer]) -> bool:
        return np.sum(np.equal(guess, self._answer), axis=1)

    def get_question(self) -> NDArray[np.integer]:
        return self._question

    def get_score(self) -> NDArray[np.integer]:
        return self._score

    def get_answer(self) -> NDArray[np.integer]:
        return self._answer


guess = Question(choice_n=4, puzzle_n=3, guess_n=5)
print(guess.get_question())
print(guess.get_score())
print(guess.get_answer())
